#define C_APPMAN		15
#define C_HWIMMAN		19

#define O_AM_INIT		1
#define O_AM_START		2
#define O_AM_STOP		3
#define O_AM_ADD_TASK		4
#define O_AM_WAIT		5
#define O_AM_LOAD_RESOURCE	6
#define O_AM_LOAD_RES_BUF	7
#define O_AM_RSCNAME		8
#define O_AM_NOTIFY		9
#define O_AM_NOTIFYERR		10
#define O_AM_CLEAN_UP		11
#define O_AM_ONLYONE		12
#define O_AM_FINDIMG		13
#define O_AM_CHANGE_PRI		14
#define O_AM_NEW_FILENAME	15
#define O_AM_YIELD		16
#define O_AM_ENSURE_IPCS	17

#include <process>

/* Load a resource into a buffer which MUST be big enough */

#define LOAD_RESBUF(id,buf)	send(peekw(DatAppMan),7,#id,buf)

/* Load a resource, allocating memory as required */

#define LOAD_RESOURCE(id,ptr)	send(peekw(DatAppMan),6,#id,ptr)
#define FREE_RESOURCE(ptr)	freealloc(ptr)

